Windowable

A generic window interface.

Should be supportive of majority of windowing toolkits in existance. Is unaware of screens.

Implementation should support two constructors:

this(T...)(T config) { this(WindowConfig(config)); }
this(WindowConfig config);
More...

Members

Functions

hide
void hide()

Shows the window.

icon
void icon(Image image)

* Sets the icon for the window. * Supports transparency. * * Params: * image = The image (from Devisualization.Image).

icon
deprecated void icon(ushort width, ushort height, ubyte[3][] data, ubyte[3]* transparent)

Sets the icon for the window. Supports transparency.

show
void show()

Hides the window.

Mixins

__anonymous
mixin IEventing!("onDraw", Windowable)
Undocumented in source.
__anonymous
mixin IEventing!("onMove", Windowable, int, int)
Undocumented in source.
__anonymous
mixin IEventing!("onResize", Windowable, uint, uint)
Undocumented in source.
__anonymous
mixin IEventing!("onClose", Windowable)
Undocumented in source.
__anonymous
mixin IEventing!("onMouseDown", Windowable, MouseButtons, int, int)
Undocumented in source.
__anonymous
mixin IEventing!("onMouseMove", Windowable, int, int)
Undocumented in source.
__anonymous
mixin IEventing!("onMouseUp", Windowable, MouseButtons)
Undocumented in source.
__anonymous
mixin IEventing!("onKeyDown", Windowable, Keys, KeyModifiers)
Undocumented in source.
__anonymous
mixin IEventing!("onKeyUp", Windowable, Keys, KeyModifiers)
Undocumented in source.

Properties

canResize
bool canResize [@property setter]

Enable / disable resizing of the window.

close
void close [@property getter]

Closes the window. The window cannot reopened once closed. *

context
IContext context [@property getter]

Gets the current context that the window has open or null for none.

fullscreen
bool fullscreen [@property setter]

Go into/out fullscreen

hasBeenClosed
bool hasBeenClosed [@property getter]

Has the window been closed?

move
void move(int x, int y)

Move the window to coordinate.

size
void size(uint width, uint height)

Resize the window.

title
string title [@property setter]

Sets the title text.

title
dstring title [@property setter]

Sets the title text.

title
wstring title [@property setter]

Sets the title text.

Static functions

messageLoop
void messageLoop()

Continues iteration of the message loop.

messageLoopIteration
void messageLoopIteration()

A single iteration of the message loop.

Detailed Description

Events Mechanism

A window support a set number of events. From those the event offer set functionality to manipulate them.

Adds a listener on an event

void addEventName(void delegate(T));
void addEventName(bool delegate(T));

Removes the provided listener

void removeEventName(bool delegate(T));
void removeEventName(void delegate(T));

Counts how many listeners for an event

size_t countEventName();

Runs the event for all listeners with the given arguments

void eventName(T);

Clears all listeners for an event

void clearEventName();

Optionally will also support:

void eventName(T[1 .. $]);

Where T[0] is Windowable. This will run the event and pass in as first argument this (Windowable).

Events: Upon the message loop drawing period this is called.<br/> onDraw = Windowable

When the message loop is informed the window has moved, this is called.<br/> onMove = Windowable, int x, int y

When the message loop is informed the window has resized, this is called.<br/> onResize = Windowable, uint newWidth, uint newHeight

When the window has been requested to be closed from the user, this is called.<br/> On this event Windowable.close must be called manually.<br/> onClose = Windowable

Meta